3.176 \(\int \cos ^4(e+f x) (a+b \sec ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=81 \[ \frac {1}{8} x \left (3 a^2+8 a b+8 b^2\right )+\frac {3 a (a+2 b) \sin (e+f x) \cos (e+f x)}{8 f}+\frac {a \sin (e+f x) \cos ^3(e+f x) \left (a+b \tan ^2(e+f x)+b\right )}{4 f} \]

[Out]

1/8*(3*a^2+8*a*b+8*b^2)*x+3/8*a*(a+2*b)*cos(f*x+e)*sin(f*x+e)/f+1/4*a*cos(f*x+e)^3*sin(f*x+e)*(a+b+b*tan(f*x+e
)^2)/f

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {4146, 413, 385, 203} \[ \frac {1}{8} x \left (3 a^2+8 a b+8 b^2\right )+\frac {3 a (a+2 b) \sin (e+f x) \cos (e+f x)}{8 f}+\frac {a \sin (e+f x) \cos ^3(e+f x) \left (a+b \tan ^2(e+f x)+b\right )}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]^4*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

((3*a^2 + 8*a*b + 8*b^2)*x)/8 + (3*a*(a + 2*b)*Cos[e + f*x]*Sin[e + f*x])/(8*f) + (a*Cos[e + f*x]^3*Sin[e + f*
x]*(a + b + b*Tan[e + f*x]^2))/(4*f)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 413

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[((a*d - c*b)*x*(a + b*x^n)^
(p + 1)*(c + d*x^n)^(q - 1))/(a*b*n*(p + 1)), x] - Dist[1/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)
^(q - 2)*Simp[c*(a*d - c*b*(n*(p + 1) + 1)) + d*(a*d*(n*(q - 1) + 1) - b*c*(n*(p + q) + 1))*x^n, x], x], x] /;
 FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, n, p, q
, x]

Rule 4146

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fre
eFactors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 + ff^2*x^2)^(m/2 - 1)*ExpandToSum[a + b*(1 + ff^2*x^2)^(n/
2), x]^p, x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[m/2] && IntegerQ[n/2]

Rubi steps

\begin {align*} \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (a+b+b x^2\right )^2}{\left (1+x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a \cos ^3(e+f x) \sin (e+f x) \left (a+b+b \tan ^2(e+f x)\right )}{4 f}+\frac {\operatorname {Subst}\left (\int \frac {(a+b) (3 a+4 b)+b (a+4 b) x^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{4 f}\\ &=\frac {3 a (a+2 b) \cos (e+f x) \sin (e+f x)}{8 f}+\frac {a \cos ^3(e+f x) \sin (e+f x) \left (a+b+b \tan ^2(e+f x)\right )}{4 f}+\frac {\left (3 a^2+8 a b+8 b^2\right ) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=\frac {1}{8} \left (3 a^2+8 a b+8 b^2\right ) x+\frac {3 a (a+2 b) \cos (e+f x) \sin (e+f x)}{8 f}+\frac {a \cos ^3(e+f x) \sin (e+f x) \left (a+b+b \tan ^2(e+f x)\right )}{4 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.11, size = 58, normalized size = 0.72 \[ \frac {4 \left (3 a^2+8 a b+8 b^2\right ) (e+f x)+a^2 \sin (4 (e+f x))+8 a (a+2 b) \sin (2 (e+f x))}{32 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]^4*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(4*(3*a^2 + 8*a*b + 8*b^2)*(e + f*x) + 8*a*(a + 2*b)*Sin[2*(e + f*x)] + a^2*Sin[4*(e + f*x)])/(32*f)

________________________________________________________________________________________

fricas [A]  time = 1.39, size = 62, normalized size = 0.77 \[ \frac {{\left (3 \, a^{2} + 8 \, a b + 8 \, b^{2}\right )} f x + {\left (2 \, a^{2} \cos \left (f x + e\right )^{3} + {\left (3 \, a^{2} + 8 \, a b\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{8 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^4*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/8*((3*a^2 + 8*a*b + 8*b^2)*f*x + (2*a^2*cos(f*x + e)^3 + (3*a^2 + 8*a*b)*cos(f*x + e))*sin(f*x + e))/f

________________________________________________________________________________________

giac [A]  time = 0.59, size = 93, normalized size = 1.15 \[ \frac {{\left (3 \, a^{2} + 8 \, a b + 8 \, b^{2}\right )} {\left (f x + e\right )} + \frac {3 \, a^{2} \tan \left (f x + e\right )^{3} + 8 \, a b \tan \left (f x + e\right )^{3} + 5 \, a^{2} \tan \left (f x + e\right ) + 8 \, a b \tan \left (f x + e\right )}{{\left (\tan \left (f x + e\right )^{2} + 1\right )}^{2}}}{8 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^4*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/8*((3*a^2 + 8*a*b + 8*b^2)*(f*x + e) + (3*a^2*tan(f*x + e)^3 + 8*a*b*tan(f*x + e)^3 + 5*a^2*tan(f*x + e) + 8
*a*b*tan(f*x + e))/(tan(f*x + e)^2 + 1)^2)/f

________________________________________________________________________________________

maple [A]  time = 1.23, size = 78, normalized size = 0.96 \[ \frac {a^{2} \left (\frac {\left (\cos ^{3}\left (f x +e \right )+\frac {3 \cos \left (f x +e \right )}{2}\right ) \sin \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+2 a b \left (\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+b^{2} \left (f x +e \right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)^4*(a+b*sec(f*x+e)^2)^2,x)

[Out]

1/f*(a^2*(1/4*(cos(f*x+e)^3+3/2*cos(f*x+e))*sin(f*x+e)+3/8*f*x+3/8*e)+2*a*b*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x
+1/2*e)+b^2*(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.46, size = 87, normalized size = 1.07 \[ \frac {{\left (3 \, a^{2} + 8 \, a b + 8 \, b^{2}\right )} {\left (f x + e\right )} + \frac {{\left (3 \, a^{2} + 8 \, a b\right )} \tan \left (f x + e\right )^{3} + {\left (5 \, a^{2} + 8 \, a b\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{4} + 2 \, \tan \left (f x + e\right )^{2} + 1}}{8 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^4*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/8*((3*a^2 + 8*a*b + 8*b^2)*(f*x + e) + ((3*a^2 + 8*a*b)*tan(f*x + e)^3 + (5*a^2 + 8*a*b)*tan(f*x + e))/(tan(
f*x + e)^4 + 2*tan(f*x + e)^2 + 1))/f

________________________________________________________________________________________

mupad [B]  time = 4.57, size = 76, normalized size = 0.94 \[ x\,\left (\frac {3\,a^2}{8}+a\,b+b^2\right )+\frac {\left (\frac {3\,a^2}{8}+b\,a\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (\frac {5\,a^2}{8}+b\,a\right )\,\mathrm {tan}\left (e+f\,x\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4+2\,{\mathrm {tan}\left (e+f\,x\right )}^2+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(e + f*x)^4*(a + b/cos(e + f*x)^2)^2,x)

[Out]

x*(a*b + (3*a^2)/8 + b^2) + (tan(e + f*x)*(a*b + (5*a^2)/8) + tan(e + f*x)^3*(a*b + (3*a^2)/8))/(f*(2*tan(e +
f*x)^2 + tan(e + f*x)^4 + 1))

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)**4*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________